//
//  artistCell.m
//  ZYTS-iPhone
//
//  Created by yuzhou on 13-2-18.
//  Copyright (c) 2013年 wzyk. All rights reserved.
//

#import "artistCell.h"
#import "UIImageView+WebCache.h"

@implementation artistCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
    }
    return self;
}

- (void)awakeFromNib
{
    photoImageView.layer.shadowColor = [UIColor blackColor].CGColor;
    photoImageView.layer.shadowOpacity = 0.45f;
    photoImageView.layer.shadowOffset = CGSizeMake(-6.0f, -8.0f);
    photoImageView.layer.masksToBounds = NO;
    UIBezierPath *path = [UIBezierPath bezierPathWithRect:photoImageView.frame];
    photoImageView.layer.shadowPath = path.CGPath;
}

- (void)updateDisplay
{
    NSString *imageURL = [[self.infoDic valueForKey:@"face_photo"] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    [photoImageView setImageWithURL:[NSURL URLWithString:imageURL] placeholderImage:[UIImage imageNamed:@"default_image"] options:SDWebImageRetryFailed];
    titleLabel.text = [self.infoDic valueForKey:@"broadcaster"];
    countLabel.text = [NSString stringWithFormat:@"共有%@部作品",[self.infoDic valueForKey:@"item_count"]];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)dealloc {
    [photoImageView release];
    [titleLabel release];
    [_infoDic release];
    [countLabel release];
    [super dealloc];
}
@end
